<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button id="de" onclick="window.localStorage.setItem('name','李四')">修改</button>
    <button id="de" onclick="window.localStorage.removeItem('person1')">删除</button>
    <button id="de" onclick="window.localStorage.clear()">清空</button>
    <script>
        // 本地存储 
        // localstorage 

        // 增  
        var obj = {
            name:'lisi',
            age:18,
            isgoodman:true,
            jingyan:null,
            height:undefined
        }
        // window.localStorage.setItem('name','zhangsan');
        // window.localStorage.setItem('age',18);
        // window.localStorage.setItem('isgoodman',true);
        // window.localStorage.setItem('jingyan',null);
        // window.localStorage.setItem('height',undefined);
        // window.localStorage.setItem('person1',obj);
        // window.localStorage.setItem('person2',JSON.stringify(obj));

        // 查

        // console.log(window.localStorage.getItem('name'));
        // console.log(window.localStorage.getItem('age'));


        // console.log(window.localStorage.getItem('person2'));
        // console.log(JSON.parse(window.localStorage.getItem('person2')));




        // 验证跨页面能不能访问 

        // window.localStorage.setItem('a','100');
        // window.localStorage.setItem('b','200');
        // window.localStorage.setItem('c','300');

        console.log(window.localStorage.getItem('panpan'));
    </script>
</body>
</html>